package com.shanxi.cz.module.biz.job;

import com.shanxi.cz.module.biz.service.AmmeterService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 定时任务-读取电表数据
 */
@Component
public class NhAmmeterRecordJob {

    protected final Logger logger = LoggerFactory.getLogger(getClass());

    @Resource
    private AmmeterService ammeterService;

    /**
     * 定时读取电表数据
     *
     * @param param 参数
     * @return
     * @throws Exception
     */
    @XxlJob("nhAmmeterRecordJob")
    public String execute(String param) {
        logger.info("定时读取电表数据===============》start");
        ammeterService.nhAmmeterRecordJob();
        logger.info("定时读取电表数据===============》end");
        return String.format("定时读取电表数据完成");
    }
}
